#include <gtk/gtk.h>
static gboolean delete_event( GtkWidget *widget, GdkEvent *event, gpointer data )
{
    g_print ("delete event occurred\n");
	return FALSE;
}
static void destroy( GtkWidget *widget, gpointer data )
{
	gtk_main_quit ();
}

int main( int argc, char *argv[] )
{
	GtkWidget *window;
	GtkWidget *label;
	gtk_init (&argc, &argv);
	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK (delete_event), NULL);
	g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy), NULL);
	label = gtk_label_new ("Hello GTK");
	gtk_container_add (GTK_CONTAINER (window), label);
	gtk_container_set_border_width (GTK_CONTAINER (window), 10);
	gtk_widget_show (label);
	gtk_widget_show (window);
	gtk_main ();
	return 0;
}